package com.xltt.watchlauncher3.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.List;
import com.xltt.watchlauncher3.R;

import com.xltt.watchlauncher3.entity.NoticationEntity;

public class NoticationListAdapter extends ListViewBaseAdapter<NoticationEntity> {

    private Context mContext;
    public NoticationListAdapter(Context context){
        this.mContext = context;
    }

    public NoticationListAdapter(Context context , List<NoticationEntity> data){
        this.mContext = context;
        this.mData = data;
    }
    
    public void notifyBluetooth(NoticationEntity noticationListEntity){
    	notifyDataSetChanged();
    }
    

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.notication_list_item_layout, null);
            holder = new ViewHolder();
            holder.content = (TextView) convertView.findViewById(R.id.content);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        String content = getItem(position).getContent();
        holder.content.setText(content);
        return convertView;
    }

    static class ViewHolder {
        TextView title,content,reviceTime;
    }
}
